package work818;

import java.io.Serializable;

public class Person implements Serializable {
  private String name;
  private String sex;
  private int age;
  private String address;
  private String phone;


  //无参构造方法
  public Person(){
    System.out.println("调用了公有、无参构造方法执行了。。。");
  }

  //有多个参数的构造方法
  public Person(String name, String sex, int age) {
    this.name = name;
    this.sex = sex;
    this.age = age;
    System.out.println("调用了公有、多个参数构造方法执行了。。。");
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSex() {
    return sex;
  }

  public void setSex(String sex) {
    this.sex = sex;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }


  @Override
  public String toString() {
    return "Person{" +
      "name='" + name + '\'' +
      ", sex='" + sex + '\'' +
      ", age=" + age +
      ", address='" + address + '\'' +
      ", phone='" + phone + '\'' +
      '}';
  }
}
